import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';

export class CreateAuthDto {
  @ApiProperty({ example: '1234567', description: '用户名' })
  @IsString()
  @IsNotEmpty({ groups: ['create'], message: '用户名必须填写' })
  username: string;

  @ApiProperty({ example: '1234567', description: '密码' })
  @IsString()
  @IsNotEmpty({ groups: ['create'], message: '密码必须填写' })
  password: string;

  @ApiProperty({ example: '0,1,2', description: '0:学生,1:老师,2管理员' })
  @IsNumber()
  @IsNotEmpty({ groups: ['create'], message: '登录角色' })
  typeNumber: number;
}
